package com.example.fengyungo.service;

import com.alipay.api.AlipayApiException;
import com.alipay.api.response.AlipayFundTransUniTransferResponse;
import com.alipay.api.response.AlipayTradeAppPayResponse;
import com.alipay.api.response.AlipayTradeRefundResponse;
import com.example.fengyungo.domain.dto.DriverOrderDTO;
import com.example.fengyungo.domain.entity.Order;

import javax.servlet.http.HttpServletRequest;

public interface PayService {

    /**
     * 获取订单信息用于用户向平台支付
     * @param order Order
     * @return AlipayTradeAppPayResponse
     */
    AlipayTradeAppPayResponse getOrderStr(Order order) throws AlipayApiException;

    /**
     * 平台退款给用户
     * @param order Order
     * @return AlipayTradeRefundResponse
     */
    AlipayTradeRefundResponse refund(Order order) throws AlipayApiException;

    /**
     * 平台向司机转账
     * @param driverOrderDTO DriverOrderDTO
     * @return AlipayFundTransUniTransferResponse
     */
    AlipayFundTransUniTransferResponse payToDriver(DriverOrderDTO driverOrderDTO) throws AlipayApiException;
}
